package com.woniuxy.third.controller;

import com.woniuxy.third.entity.EduSubject;
import com.woniuxy.third.entity.subject.FirstSubject;
import com.woniuxy.third.result.ResponseResult;
import com.woniuxy.third.service.EduSubjectService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/*
* 课程分类管理*/
@RestController
@RequestMapping("/edusubject")
public class EduSubjectController {
    @Resource
    private EduSubjectService eduSubjectService;
    /*课程分类列表（树形）*/
    @GetMapping("/getAllsubject")
    public ResponseResult<List<FirstSubject>> getAllSubject(){
        //List返回一级学科
        List<FirstSubject> list=eduSubjectService.getAllFirstSecondSubject();
        ResponseResult<List<FirstSubject>> result = new ResponseResult<List<FirstSubject>>();
        result.setData(list);
        return result;
    }

}
